package com.wwwarehouse.financialcenter.fragment.moneywarehouse.homepage;

import android.os.Bundle;
import android.view.View;
import android.view.animation.Animation;
import android.widget.LinearLayout;

import com.wwwarehouse.common.bean.carddesk.CardDeskMessageStableCardBean;
import com.wwwarehouse.common.bean.response.CommonClass;
import com.wwwarehouse.financialcenter.R;
import com.wwwarehouse.financialcenter.bean.bindingcard.MoneyHouseInfomationBean;
import com.wwwarehouse.financialcenter.fragment.base.TheParentFragment;
import com.wwwarehouse.financialcenter.fragment.moneywarehouse.billingrecords.ChargingRecordPagerFragment;
import com.wwwarehouse.financialcenter.fragment.moneywarehouse.bills.BillViewPagerFragment;

import java.util.List;

/**
 * @author Joseph on 2017/11/14.
 *         <p/>
 *         企业钱仓子类
 */

public class MoneyHomeChildFragment extends TheParentFragment implements View.OnClickListener {

    private LinearLayout mBill ;
    private LinearLayout mCharging ;
    private LinearLayout mBankCard ;
    private MoneyHouseInfomationBean.DataBean data;  //单个业务单位
    private Bundle bundle;
    private List<MoneyHouseInfomationBean.DataBean> moneyHomeDataList; //所有的业务单位

    @Override
    protected int getContentId() {
        return R.layout.financial_center_money_home_child_fragment;
    }

    @Override
    public Animation onCreateAnimation(int transit, boolean enter, int nextAnim) {
        return null;
    }

    @Override
    protected void init(View view) {
        bundle = getArguments();
        if (bundle !=null){
            data = (MoneyHouseInfomationBean.DataBean) bundle.getSerializable("moneyHomeData");
            moneyHomeDataList = (List<MoneyHouseInfomationBean.DataBean>) bundle.getSerializable("moneyHomeDataList");
        }
        mBill = findView(view,R.id.ll_billin);
        mCharging = findView(view,R.id.ll_charging);
        mBankCard = findView(view,R.id.ll_bank_card);
        mBill.setOnClickListener(this);
        mCharging.setOnClickListener(this);
        mBankCard.setOnClickListener(this);
    }
    @Override
    public void onSuccess(CommonClass commonClass, int what) {

    }

    @Override
    public void onReLoad(int code) {

    }

    @Override
    public void onClick(View v) {
        int i = v.getId();
        if (i == R.id.ll_billin) {
            //账单
            BillViewPagerFragment fragment = new BillViewPagerFragment();
            fragment.setArguments(bundle);
            pushFragment(fragment);

        } else if (i == R.id.ll_charging) {
            //计费
            ChargingRecordPagerFragment fragment = new ChargingRecordPagerFragment();
            fragment.setArguments(bundle);
            pushFragment(fragment);

        } else if (i == R.id.ll_bank_card) {
            //银行卡
            BankCardInfomationFragment bankCardInfomationFragment = new BankCardInfomationFragment();
            bankCardInfomationFragment.setArguments(bundle);
            pushFragment(bankCardInfomationFragment);
        }
    }
}
